package model

import (
	"context"

	"gorm.io/gorm"
)

type defaultTagModel struct {
	db *gorm.DB
}

func NewTagModel(db *gorm.DB) TagModel {
	return &defaultTagModel{
		db: db,
	}
}

type TagModel interface {
	CreateTag(ctx context.Context, tagMap *TagMap) error
	FindOrCreate(ctx context.Context, tagName string) (*BlogTag, error)
	IncrementBlogNum(ctx context.Context, tagId uint) error
}
